package ua.kpi.ipsa.expert.api.adminpanel;

import javax.swing.*;
import net.miginfocom.swing.MigLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class UserAddPanel extends JPanel {
	private JTextField loginField;
	private JPasswordField passwordField;
	private JPasswordField confirmPasswordField;
	private JButton btnAdd;
	private JButton btnCancel;

	/**
	 * Create the panel.
	 */
	public UserAddPanel() {
		setLayout(new MigLayout("", "[][grow]", "[][][][]"));
		
		JLabel lblLogin = new JLabel("Login:");
		add(lblLogin, "cell 0 0,alignx right");
		
		loginField = new JTextField();
		add(loginField, "cell 1 0,growx");
		loginField.setColumns(10);
		
		JLabel lblNewLabel_1 = new JLabel("Pass:");
		add(lblNewLabel_1, "cell 0 1,alignx trailing");
		
		passwordField = new JPasswordField();
		add(passwordField, "cell 1 1,growx");
		
		JLabel lblNewLabel_2 = new JLabel("Confirm pass:");
		add(lblNewLabel_2, "cell 0 2,alignx trailing");
		
		confirmPasswordField = new JPasswordField();
		add(confirmPasswordField, "cell 1 2,growx");
		
		btnAdd = new JButton("Add");
		btnAdd.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
			}
		});
		add(btnAdd, "flowx,cell 1 3,alignx right");
		
		btnCancel = new JButton("Cancel");
		add(btnCancel, "cell 1 3,alignx right");
	}

	public JTextField getLoginField() {
		return loginField;
	}
	public JPasswordField getPasswordField() {
		return passwordField;
	}
	public JPasswordField getConfirmPasswordField() {
		return confirmPasswordField;
	}
	public JButton getBtnAdd() {
		return btnAdd;
	}
	public JButton getBtnCancel() {
		return btnCancel;
	}
}
